﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SimpleWeather.WeatherService;
using StyleMVVM.DependencyInjection;

namespace SimpleWeather.NonRunTime
{
	[NonRunTimeExport]
	[Export(typeof(WeatherSoap))]
	public class FauxWeatherSoapClient : WeatherSoap
	{
		public async Task<GetWeatherInformationResponse> GetWeatherInformationAsync(GetWeatherInformationRequest request)
		{
			GetWeatherInformationResponse response = new GetWeatherInformationResponse();

			response.GetWeatherInformationResult = new WeatherDescription[1];

			response.GetWeatherInformationResult[0] = new WeatherDescription
																		{
																			Description = "Partly Cloudy",
																			PictureURL = "http://ws.cdyne.com/WeatherWS/Images/partlycloudy.gif",
																			WeatherID = 10,
																		};

			return response;
		}

		public async Task<ForecastReturn> GetCityForecastByZIPAsync(string ZIP)
		{
			ForecastReturn forecastReturn = new ForecastReturn
														  {
															  ForecastResult = new Forecast[5]
														  };

			forecastReturn.ForecastResult[0] = new Forecast
																{
																	Date = DateTime.Now.Date,
																	Desciption = "Partly Cloudy",
																	WeatherID = 10,
																	Temperatures = new temp
																							{
																								DaytimeHigh = "95",
																								MorningLow = "60"
																							},
																	ProbabilityOfPrecipiation = new POP
																											{
																												Daytime = "10",
																												Nighttime = "10"
																											},
																};

			forecastReturn.ForecastResult[1] = new Forecast
																{
																	Date = DateTime.Now.AddDays(1).Date,
																	Desciption = "Partly Cloudy",
																	WeatherID = 10,
																	Temperatures = new temp
																	{
																		DaytimeHigh = "92",
																		MorningLow = "61"
																	},
																	ProbabilityOfPrecipiation = new POP
																	{
																		Daytime = "15",
																		Nighttime = "15"
																	},
																};

			forecastReturn.ForecastResult[2] = new Forecast
																{
																	Date = DateTime.Now.AddDays(2).Date,
																	Desciption = "Partly Cloudy",
																	WeatherID = 10,
																	Temperatures = new temp
																	{
																		DaytimeHigh = "85",
																		MorningLow = "55"
																	},
																	ProbabilityOfPrecipiation = new POP
																	{
																		Daytime = "20",
																		Nighttime = "20"
																	},
																};

			forecastReturn.ForecastResult[3] = new Forecast
																{
																	Date = DateTime.Now.AddDays(3).Date,
																	Desciption = "Partly Cloudy",
																	WeatherID = 10,
																	Temperatures = new temp
																	{
																		DaytimeHigh = "90",
																		MorningLow = "60"
																	},
																	ProbabilityOfPrecipiation = new POP
																	{
																		Daytime = "20",
																		Nighttime = "20"
																	},
																};

			forecastReturn.ForecastResult[4] = new Forecast
																{
																	Date = DateTime.Now.AddDays(4).Date,
																	Desciption = "Partly Cloudy",
																	WeatherID = 10,
																	Temperatures = new temp
																	{
																		DaytimeHigh = "85",
																		MorningLow = "55"
																	},
																	ProbabilityOfPrecipiation = new POP
																	{
																		Daytime = "10",
																		Nighttime = "10"
																	},
																};

			return forecastReturn;
		}

		public async Task<WeatherReturn> GetCityWeatherByZIPAsync(string ZIP)
		{
			WeatherReturn returnValue =
				new WeatherReturn
					{
						City = "Boston",
						State = "MA",
						Temperature = "78",
						Description = "Partly Cloudy",
						Pressure = "30.00",
						RelativeHumidity = "20"
					};

			return returnValue;
		}
	}
}
